class MailController
{

    private scalex = Laya.stage.width / Laya.stage.designWidth;
    private scaley = Laya.stage.height / Laya.stage.designHeight;

    constructor() 
    {

    }

    //显示界面
    ShowDlg()
    {
        //Game.mail.ResetScrollView();
        //Game.mail.pos( 0 , 0);
        view.dlg.Mail.getMail().popup();
    }

    //关闭显示界面
    CloseDlg()
    {
        view.dlg.Mail.getMail().close();
    }

    //向服务器发送当前查看动态的时间
    mailLook(){
        ComFun.BaseCall("mailLook");
    }

    //显示或隐藏邮件的气泡
    disBubble(visible : boolean){
        Game.viewFarm.mailbtn.getChildByName("bubble")["visible"] = visible;
        view.dlg.Mail.getMail().mail_new.visible = visible;
    }

    //设置邮件气泡
    setBubble(){
        if(KBEngine.app.player().mail_info_list == null || KBEngine.app.player().mail_info_list.length<=0){
            this.disBubble(false);
            return;
        }
        if(KBEngine.app.player().mail_info_list[0].opt_time > KBEngine.app.player().mail_look_time){
            this.disBubble(true);
        }else{
            this.disBubble(false);
        }
    }

}